package org.dragonnova.meetingserver.server.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import org.dragonnova.meetingserver.R;
import org.dragonnova.meetingserver.server.activity.MainActivity;
import org.dragonnova.meetingserver.utils.LogUtil;
import org.dragonnova.meetingserver.utils.PromptUtil;

/**
 * Created by hucn on 2016/3/16.
 * Description:
 */
public class BootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        //装在system/app下会触发这个广播接收者，不然视设备而定
        LogUtil.eee("start the activity when reboot");

        PromptUtil.poolPlay(context, R.raw.reboot);

        Intent aIntent = new Intent(context, MainActivity.class);
        aIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(aIntent);
        LogUtil.eee("start the service when reboot");
        /*Intent sIntent = new Intent(context, RestartService.class);
        context.startService(sIntent);*/
    }
}
